package com.jzqf.harmonydemo.provider;

import com.jzqf.harmonydemo.ResourceTable;
import com.jzqf.harmonydemo.base.BaseProvider;
import com.jzqf.harmonydemo.base.BaseViewHolder;
import com.jzqf.harmonydemo.model.MenuItem;
import ohos.aafwk.ability.AbilitySlice;

import java.util.List;

public class MenuProvider extends BaseProvider<MenuItem> {

    public MenuProvider(AbilitySlice abilitySlice) {
        super(abilitySlice);
    }

    public MenuProvider(AbilitySlice abilitySlice, List<MenuItem> list) {
        super(abilitySlice, list);
    }

    @Override
    protected int getLayoutId() {
        return ResourceTable.Layout_item_menu;
    }

    @Override
    protected void bindData(BaseViewHolder holder, int position) {
        MenuItem model = getItem(position);
        holder.setText(ResourceTable.Id_item_desc_btn, model.getDesc());
        holder.addClickedListener(ResourceTable.Id_item_desc_btn);
    }
}
